-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test to check missing fields in cpe_helper
file
#3766
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jmv74211
approved these changes
Feb 2, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.9.7, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.9.7', 'Platform': 'Linux-5.4.0-86-generic-x86_64-with-glibc2.31', 'Packages': {'pytest': '6.2.3', 'py': '1.10.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.11.0', 'html': '3.1.1', 'testinfra': '5.0.0'}}
rootdir: /home/vagrant/wazuh-qa/tests/integration, configfile: pytest.ini
plugins: metadata-1.11.0, html-3.1.1, testinfra-5.0.0
collected 26 items
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_tags[Wrong source vendor fields] PASSED [ 3%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_tags[Wrong translation product fields] PASSED [ 7%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_tags[Wrong version field] PASSED [ 11%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_tags[Wrong format_version fields] PASSED [ 15%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_tags[Wrong update_date fields] PASSED [ 19%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_tags[Wrong target field] PASSED [ 23%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Wrong version value] PASSED [ 26%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Wrong update_date value] PASSED [ 30%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Wrong target value] PASSED [ 34%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Wrong format_version value] PASSED [ 38%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Wrong source vendor value] PASSED [ 42%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Wrong source product value] PASSED [ 46%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_wrong_values[Wrong action value] PASSED [ 50%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Missing version field] PASSED [ 53%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Missing format_version field] PASSED [ 57%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Missing update_date field] PASSED [ 61%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Missing target field] PASSED [ 65%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Missing action field] PASSED [ 69%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Missing vendor field] PASSED [ 73%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_missing_field[Missing product field] PASSED [ 76%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_empty_fields[Missing vendor field] PASSED [ 80%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_empty_fields[Missing vendor and version fields] PASSED [ 84%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_empty_fields[Missing set_version_if_product_matches action field] PASSED [ 88%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_empty_fields[Replace_vendor instead of set_version_if_product_matches action fields] PASSED [ 92%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_empty_fields[Missing all source fields] PASSED [ 96%]
test_vulnerability_detector/test_cpe_helper/test_cpe_helper.py::test_cpe_indexing_empty_vendor_version[Missing all the source fields and version translation field] PASSED [100%]
========================================================================================= 26 passed in 815.79s (0:13:35) ==========================================================================================
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR aims to add tests to check if
cpe_helper.json
dictionary works correctly when there are missing fields.Added
Testing performed